package weibo4j.util;

import java.io.FileNotFoundException;
import java.io.PrintStream;

public class LogStream extends PrintStream {
    private StringBuffer sbInfo = new StringBuffer();
    private String strInfo = "";

    public LogStream(String s) throws FileNotFoundException {
        super(s);
    }

    public void print(boolean flag) {
        super.print(flag);
        sbInfo.append(flag);
    }

    public void print(char c) {
        super.print(c);
        sbInfo.append(c);
    }

    public void print(long l) {
        super.print(l);
        sbInfo.append(l);
    }

    public void print(double d) {
        super.print(d);
        sbInfo.append(d);
    }

    public void print(char ac[]) {
        super.print(ac);
        sbInfo.append(ac);
    }

    public void print(String s) {
        super.print(s);
        sbInfo.append(s);
    }

    public void print(Object obj) {
        super.print(obj);
        sbInfo.append(obj);
    }

    public void println() {
        super.println();
        sbInfo.append('\n');
    }

    public void println(boolean flag) {
        super.println(flag);
        sbInfo.append(flag).append('\n');
    }

    public void println(char c) {
        super.println(c);
        sbInfo.append(c).append('\n');
    }

    public void println(int i) {
        super.println(i);
        sbInfo.append(i).append('\n');
    }

    public void println(long l) {
        super.println(l);
        sbInfo.append(l).append('\n');
    }

    public void println(float f) {
        super.println(f);
        sbInfo.append(f).append('\n');
    }

    public void println(double d) {
        super.println(d);
        sbInfo.append(d).append('\n');
    }

    public void println(char ac[]) {
        super.println(ac);
        sbInfo.append(ac).append('\n');
    }

    public void println(String s) {
        super.println(s);
        sbInfo.append(s).append('\n');
    }

    public void println(Object obj) {
        super.println(obj);
        sbInfo.append(obj).append('\n');
    }

    public String getString() {
        strInfo = sbInfo.toString();
        sbInfo.setLength(0);
        return strInfo;
    }
}